package cn.com.zcode.core.dao;

import java.util.List;

import cn.com.zcode.core.model.BaseModelSupport;

public interface BaseDao {

	public <M extends BaseModelSupport> M save(M t);

	public <M extends BaseModelSupport> void edit(M t);

	public void delete(String id, Class<? extends BaseModelSupport> zlass);

	public <M extends BaseModelSupport> M get(String id, Class<M> zlass);

	public <O> O getByHQL(String hql, Class<O> mlass,Object ...pram);

	public <M extends BaseModelSupport> void delete(M persistentInstance);

	public <M extends BaseModelSupport> List<M> findByHQL(String hql, Class<M> zlass);

	public <M extends BaseModelSupport> List<M> findByExample(M instance);

	public <M extends BaseModelSupport> List<M> findByProperty(String propertyName, Object value, Class<M> zlass);

	public <M extends BaseModelSupport> List<M> findAll(Class<M> zlass);

	public <M extends BaseModelSupport> List<M> findAll(String[] orders, String[] wherecond, Class<M> zlass);

	public <M extends BaseModelSupport> M merge(M detachedInstance);

	public <M extends BaseModelSupport> void saveOrUpdate(M instance);

	 
}
